
from dexen.libs import dexen_api, constants as dc

from scripts.utils import constants


settings_api = dexen_api.getSettingsApi()
settings_api.setDataStructure(
    attributes = {
        "state":dc.BOOLEAN,
        'gamma_x':dc.BLOB,
        'gamma_y':dc.BLOB,
        'orient':dc.BLOB,
        'encoding':dc.BLOB,
        'phenotype':dc.BLOB,
        'min_width':dc.FLOAT,
        'min_height':dc.FLOAT,
        'area':dc.FLOAT,
    }
)

settings_api.setMaxIndividuals(constants.MAX_INDIVIDUALS)

"""
settings_api.setObjectives(
    attributes = (
        ("min_width", dc.MINIMIZE),
        ("min_height", dc.MAXIMIZE)
    )
)
"""

settings_api.setScript(
    script_name = "initialization",             
    file_name = "scripts.initialization", 
    function_name = "initialise"
)

settings_api.setScript(
    script_name = "development", 
    file_name = "scripts.development", 
    function_name = "develop" 
)

settings_api.setScript(
    script_name = "evaluation", 
    file_name = "scripts.evaluation", 
    function_name = "evaluate" 
)

settings_api.setScript(
    script_name = "feedback",    
    file_name = "scripts.feedback", 
    function_name = "feedback" 
)

settings_api.setScript(
    script_name = "visualization",
    file_name = "scripts.visualization",
    function_name = "draw_pareto"
)
